package org.thread.test06.demo02;

/**
 * 男孩
 * @author ZJL
 * @date 2025-03-14
 */
public class BoyThread extends Thread {
    /**
     * 男孩要使用的篮子
     */
    private Box box;
    /**
     * 男孩的姓名
     */
    private String name;
    public BoyThread(){

    }
    public BoyThread(Box box, String name) {
        this.box = box;
        this.name = name;
    }
    @Override
    public void run() {
        while (true) {
            Fruit fruit = new Fruit();
            box.put(name,fruit);
        }
    }
}
